﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Concat
{
    [System.Diagnostics.DebuggerNonUserCode]
    class Token
    {
        public string text;
        public Location loc;
        public int len;

        public Token(string text, Location loc)
        {
            this.text = text;
            this.loc = loc;
            this.len = text.Length;
        }
    }

    [System.Diagnostics.DebuggerNonUserCode]
    class EOFToken : Token
    {
        public EOFToken(Location loc)
            : base("", loc)
        {
        }

        public override string ToString()
        {
            return "EOF";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class IntToken : Token
    {
        public long value;

        public IntToken(string text, Location loc)
            : base(text, loc)
        {
            this.value = long.Parse(text);
        }

        public override string ToString()
        {
            return "int:" + value;
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class NumToken : Token
    {
        public double value;

        public NumToken(string text, Location loc)
            : base(text, loc)
        {
            this.value = double.Parse(text);
        }

        public override string ToString()
        {
            return "num:" + value;
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class StrToken : Token
    {
        public string data;

        public StrToken(string text, string data, Location loc)
            : base(text, loc)
        {
            this.data = data;
        }

        public override string ToString()
        {
            return "str:" + text;
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class SymToken : Token
    {
        public string symbol;

        public SymToken(string text, string symbol, Location loc)
            : base(text, loc)
        {
            this.symbol = symbol;
        }

        public override string ToString()
        {
            return "sym:" + symbol;
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class IdentToken : Token
    {
        public string ident;

        public IdentToken(string text, string ident, Location loc)
            : base(text, loc)
        {
            this.ident = ident;
        }

        public override string ToString()
        {
            return "ident:" + ident;
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class DefToken : IdentToken
    {
        public DefToken(Location loc)
            : base("def", "def", loc)
        {
        }

        public override string ToString()
        {
            return "def";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class StructToken : IdentToken
    {
        public StructToken(Location loc)
            : base("struct", "struct", loc)
        {
        }

        public override string ToString()
        {
            return "struct";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class ExtendStructToken : IdentToken
    {
        public ExtendStructToken(Location loc)
            : base("extend-struct", "extend-struct", loc)
        {
        }

        public override string ToString()
        {
            return "extend-struct";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class DefMethodToken : IdentToken
    {
        public DefMethodToken(Location loc)
            : base("proc", "proc", loc)
        {
        }

        public override string ToString()
        {
            return "proc";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class ClassToken : IdentToken
    {
        public ClassToken(Location loc)
            : base("class", "class", loc)
        {
        }

        public override string ToString()
        {
            return "class";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class ExtendClassToken : IdentToken
    {
        public ExtendClassToken(Location loc)
            : base("extend-class", "extend-class", loc)
        {
        }

        public override string ToString()
        {
            return "extend-class";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class ClassMemberToken : IdentToken
    {
        public ClassMemberToken(Location loc)
            : base("class-member", "class-member", loc)
        {
        }

        public override string ToString()
        {
            return "class-member";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class LeftBracketToken : Token
    {
        public LeftBracketToken(Location loc)
            : base("[", loc)
        {
        }

        public override string ToString()
        {
            return "[";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class RightBracketToken : Token
    {
        public RightBracketToken(Location loc)
            : base("]", loc)
        {
        }

        public override string ToString()
        {
            return "]";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class LeftParenToken : Token
    {
        public LeftParenToken(Location loc)
            : base("(", loc)
        {
        }

        public override string ToString()
        {
            return "(";
        }
    }
    [System.Diagnostics.DebuggerNonUserCode]
    class RightParenToken : Token
    {
        public RightParenToken(Location loc)
            : base(")", loc)
        {
        }

        public override string ToString()
        {
            return ")";
        }
    }
}
